home *** CD-ROM | disk | FTP | other *** search
- DEFINT A-Z
- DECLARE SUB blink (blinkLine%, blinkText$)
- DECLARE SUB editor (Text$, dline%, leftCol%, rightCol%, keycode%)
- DECLARE SUB mainMenu ()
- DECLARE SUB FkeySelect (FkeyPressed%)
- DECLARE SUB center (linenumber%, centeredText$)
- DECLARE SUB clearline (linenumber%)
- DECLARE SUB drawBox (row1, col1, row2, col2)
-
- ' twotapLB.bas - 'generic' SUBs for twotap.bas
- '
- ' You may eventually want to incorporate these routines into
- ' a .LIB file, they are general in their function, not just for
- ' the TWOTAP.BAS program.
- '
- '
-
- SUB center (linenumber, centeredText$)
- 'centers a line of text on designated line.
-
- IF LEN(centeredText$) > 76 THEN centeredText$ = LEFT$(centeredText$, 76)
- tabPoint = (80 - LEN(centeredText$)) \ 2
- IF tabPoint = 0 THEN tabPoint = 1
- IF linenumber = 0 THEN linenumber = 1
- LOCATE linenumber, tabPoint, 0: PRINT centeredText$;
-
- END SUB
-
- SUB drawBox (row1, col1, row2, col2)
-
- ' calculate the width of the box
-
- wide% = col2 - col1 - 1
-
- ' Now draw the top of the box
-
- LOCATE row1, col1, 0
- PRINT CHR$(201);
- PRINT STRING$(wide%, 205);
- PRINT CHR$(187);
-
- ' . . . and the sides
-
- lastSpace$ = ""
-
- ' if there is room, we put a 'shadow' on the right side
-
- IF row2 <> 25 AND col2 <= 78 THEN lastSpace$ = "█"
-
- FOR row3% = row1 + 1 TO row2 - 1
- LOCATE row3%, col1, 0
- PRINT CHR$(186);
- PRINT SPACE$(wide%);
- PRINT CHR$(186);
- PRINT lastSpace$;
- NEXT row3%
-
- IF row2 < 25 AND col2 <= 79 THEN
- LOCATE CSRLIN + 1, POS(0) - 1
- PRINT lastSpace$;
- END IF
-
- ' now draw the bottom of the box
-
- LOCATE row2, col1, 0
- PRINT CHR$(200);
- PRINT STRING$(wide%, 205);
- PRINT CHR$(188);
-
- ' do shadow if there is room
-
- IF row2 <> 25 AND col2 <= 79 THEN
- LOCATE row2 + 1, col1 + 3, 0
- PRINT STRING$(wide%, 219);
- END IF
-
- END SUB
-
- SUB FkeySelect (FkeyPressed)
-
- keyPress$ = ""
- FkeyPressed = 0
-
- DO UNTIL keyPress$ > ""
- keyPress$ = INKEY$
- LOOP
-
- IF LEN(keyPress$) <> 2 THEN
-
- ' good programming will always let an ESC key press back out
- ' of what the operator is doing. ESC is CHR$(27), so this IF
- ' block lets the operator quit even though we want an F key only.
-
- IF keyPress$ = CHR$(27) THEN
- center 24, " You pressed the ESC key "
- SLEEP 1
- FkeyPressed = 27
- EXIT SUB
- END IF
- SOUND 1600, 1
- '
- ' It would be a nice touch, if you have access to PDS 7.1, to
- ' use the assembly lanuguage routines (a library) that are
- ' called by the getBackground and putBackground SUBs in the
- ' windows.bas program in the User Interface library. They
- ' capture and restore portions of the screen very quickly.
- ' for this system to be "free standing" we remmed out these
- ' lines and just "blank" the phrase we print on line 24
-
- 'getbackground 24, 1, 25, 80, line25$
-
- center 24, " F keys only here "
- SLEEP 1: center 24, SPACE$(70)
- center 24, " Touch an F key to Select. "
-
- 'putBackground 24, 1, line25$
-
- FkeySelect FkeyPressed
- END IF
-
- IF LEN(keyPress$) = 2 THEN
- FkeyPressed$ = RIGHT$(keyPress$, 1)
- FkeyPressed = ASC(FkeyPressed$)
- FkeyPressed = FkeyPressed - 58
- END IF
-
- IF FkeyPressed = 76 THEN FkeyPressed = 12: EXIT SUB
- IF FkeyPressed = 75 THEN FkeyPressed = 11: EXIT SUB
- IF FkeyPressed >= 1 AND FkeyPressed <= 10 THEN EXIT SUB
-
- SOUND 1200, 1
- 'getbackground 24, 1, 25, 80, line25$
- center 24, " F keys only here "
- SLEEP 1: center 24, SPACE$(70)
- 'putBackground 24, 1, line25$
- keyPress$ = ""
- FkeyPressed$ = ""
- FkeyPressed = 0
- FkeySelect FkeyPressed
-
- END SUB
-
- SUB screenTexture
- CLS ' don't seem to be able to avoid blinking
- 'EXIT SUB
-
- FOR sf = 1 TO 24
- PRINT STRING$(80, 176); ' fills screen with ░
- NEXT sf
-
- END SUB
-
- SUB shareWare
-
- DIM m$(1 TO 32)
-
- m$(1) = " This program is distributed under the 'Shareware' Concept."
- m$(2) = ""
- m$(3) = "That is: You can 'Try Before You Buy.'"
- m$(4) = ""
- m$(5) = "You get a fully functioning program -- in this particular case"
- m$(6) = "even source code -- for free, or at least nominal download,"
- m$(7) = "disk duplication/distribution expense."
- m$(8) = ""
- m$(9) = "If you find the program useful, you can support the "
- m$(10) = "concept of Shareware by registering it for $25 (US Funds)"
- m$(11) = ""
- m$(12) = "In addition to supporting & encouraging the creation of"
- m$(13) = "quality software you can try before spending a lot of money,"
- m$(14) = "I will send you BONUS software:"
- m$(15) = ""
- m$(16) = " 1. The Latest Version of the Program"
- m$(17) = " (Source code IS included.)"
- m$(18) = ""
- m$(19) = " 2. Five (5) genuinely useful SUBs that"
- m$(20) = " enhance the operation of this program"
- m$(21) = " AND can be used in other programs you"
- m$(22) = " write ROYALTY FREE, source code included."
- m$(23) = ""
- m$(24) = " 3. Free subscription to TWOTAP newsletter."
- m$(25) = " (Smart things being done with the program"
- m$(26) = " all over the world - prompt notification of"
- m$(27) = " upgrades and improvements."
- m$(28) = ""
- m$(29) = "To Register: Send $25 (US Funds) to:"
- m$(30) = ""
- m$(31) = "Kirk Woodward d/b/a People Centered Programs ∙ PO Box 610171"
- m$(32) = " Dallas, TX 76051-0171 ∙ CompuServe 70146,51 ∙ 817-488-4940"
-
- FOR p = 1 TO 14
- PRINT ; " "; m$(p)
- NEXT p
-
- LOCATE 25, 28: COLOR 23, 0: PRINT " Any key continues . . . ";
- SLEEP 1
- LOCATE 25, 28: COLOR 15, 0: PRINT " Any key continues . . . ";
- SLEEP 1
- LOCATE 25, 28: COLOR 7, 0: PRINT " Any key continues . . . ";
-
- SLEEP
- CLS
-
- FOR p = 15 TO 32
- PRINT ; " "; m$(p)
- NEXT p
-
- LOCATE 25, 28: COLOR 7, 0: PRINT " Any key ends . . . ";
-
- SLEEP
-
- END SUB
-
- SUB windowBar (startBar, stopBar)
-
- LOCATE CSRLIN, startBar: PRINT "╠"; STRING$(stopBar - startBar - 1, "═"); "╣"
-
- END SUB
-
- SUB windowDivider (topLine, howLong, atCol)
-
- ' prints a verticle window bar at the column desigated
-
-
- LOCATE topLine, atCol: PRINT "╦"
- FOR b = 1 TO howLong - 1
- LOCATE topLine + b, atCol: PRINT "║"
- NEXT b
- LOCATE CSRLIN, atCol: PRINT "╩"
-
- END SUB
-
-